//
//  ChoosenView.m
//  EasyToo
//
//  Created by Jr Lan on 13-9-4.
//
//

#import "ChoosenView.h"
#import "DeviceUtil.h"

@implementation ChoosenView

@synthesize seatlist;

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

//初始化视图
- (void)init_view
{
    UILabel *bgLbl = [[[UILabel alloc]initWithFrame:CGRectMake(0, 0, [DeviceUtil getScreenWidth], 60)]autorelease];
    bgLbl.backgroundColor = [UIColor blueColor];
    [self addSubview:bgLbl];
    
    int i;
    for (i = 0; i < [seatlist count]; i ++) {
        UILabel *seatLbl;
        if (i > 2) {
            seatLbl = [[UILabel alloc]initWithFrame:CGRectMake(20 + (i-3)*100, 30, 60, 30)];
        } else {
            seatLbl = [[UILabel alloc]initWithFrame:CGRectMake(20 + i*100, 0, 60, 30)];
        }
        ChooseSeatInfo *chooseinfo = [seatlist objectAtIndex:i];
        int indexi = [[[seatlist objectAtIndex:i]objectAtIndex:0] intValue] + 1;
        int indexj = [[[seatlist objectAtIndex:i]objectAtIndex:1] intValue] + 1;
        seatLbl.text = [NSString stringWithFormat:@"%d排%d座", indexi, indexj];
        seatLbl.backgroundColor = [UIColor clearColor];
        seatLbl.textColor = [UIColor whiteColor];
        seatLbl.adjustsFontSizeToFitWidth = YES;
        [self addSubview:seatLbl];
        [seatLbl release];
    }
    
//    //前往购买 
//    UIButton *nextStep =[[UIButton alloc]initWithFrame:CGRectMake(00, 60, 320, 30)];
//    [nextStep setBackgroundImage:[UIImage imageNamed:@"xyb"] forState:UIControlStateNormal];
//    [nextStep setTitle:@"下一步" forState:UIControlStateNormal];
//    [self addSubview:nextStep];
//    [nextStep addTarget:self action:@selector(buyEvent) forControlEvents:UIControlEventTouchUpInside];
}

//- (void)buyEvent
//{
//    [self.payDelegate clickNextDelegate];
//}

@end

@implementation ChooseSeatInfo

@end


